﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace Protocolo.Utilidades
{
    public class Checksum
    {
        public static string ObtenerChecksum(byte[] archivo)
        {
            MD5 md5 = new MD5CryptoServiceProvider();

            StringBuilder sb = new StringBuilder();

            foreach (byte b in md5.ComputeHash(archivo))
                sb.Append(b.ToString("x2").ToLower());

            return sb.ToString();
        }
    }
}
